<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let arr = ['q',1,2,3,4, 'w']
 
    let result = arr.find(item => {  // 查找的元素
      return item === 'w'
    })

    let index = arr.findIndex(item => {   //查找的元素对应的索引
      return item === 'w'
    })

    let flag = arr.includes('q')  // 是否包含

    console.log(result, index, flag)
  </script>
</body>
</html>